<template>
  <div style="height: 86vh">
    <div class="btn-zone">
      <el-radio-group v-model="type" @change="switchSrc">
        <el-radio-button :label="0">智寰</el-radio-button>
        <el-radio-button :label="1">容知</el-radio-button>
      </el-radio-group>
    </div>
    <iframe :src="iframeSrc" frameborder="no" :style="iframeStyle" scrolling="auto"></iframe>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const iframeStyle = ref({
  width: '100%',
  height: '100%'
})

const type = ref(0)

const iframeSrc = ref('')
function switchSrc(t) {
  let src = [
    'http://10.180.10.46/zeusmap/dashboard/machines?appType=micro&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc0FkbWluIjpmYWxzZSwiZXhwIjo0ODUxNjQ4MDY5LCJ1c2VySWQiOjM4MCwidXNlcm5hbWUiOiJtYW5hZ2VyIn0.iuQjopZ1UDX89aO5xwEgBddDzMpM3PTj17IgItPXwSI',
    'http://10.180.10.45:31000/api/basicService/customtokengrant/redirectto?target=/home/overview.line?embedded=1&ent=COMMON&name=杨月&account=yangyue&hideMenu=1'
  ]
  iframeSrc.value = src[t]
}
switchSrc(0)
</script>

<style scoped>
.btn-zone {
  position: absolute;
  left: 50%;
  bottom: 2%;
  transform: translate(-50%, -50%);
}
</style>
